//package com.etc.factory;
//
////抽象产品
//interface Car {
//	public void drive();
//}
//
/////具体产品
//class Benz implements Car {
//	public void drive() {
//		System.out.println("Driving Benz ");
//	}
//}
/////具体产品
//class Bmw implements Car {
//	public void drive() {
//		System.out.println("Driving Bmw ");
//	}
//}
///////具体产品
//class Audi implements Car {
//	public void drive() {
//		System.out.println("Driving Audi ");
//	}
//}
//
//class Mi implements Car {
//    public void drive() {
//        System.out.println("Driving Mi ");
//    }
//}
//
////抽象工厂
//interface Driver {
//	public Car driverCar();
//}
//
//class BenzDriver implements Driver {
//	public Car driverCar() {
//		return new Benz();
//	}
//}
//
//class BmwDriver implements Driver {
//	public Car driverCar() {
//		return new Bmw();
//	}
//}
//
//
//class MiDriver implements Driver {
//    public Car driverCar() {
//        return new Mi();
//    }
//}
//
//public class MagnateFactoryMethod {
//	public static void main(String[] args) {
//		try {
//			Driver driver = new BenzDriver();
//			Car car = driver.driverCar();
//			car.drive();
//
//            MiDriver driver1 = new MiDriver();
//            Car mi = driver1.driverCar();
//            mi.drive();
//		} catch (Exception e) {
//		}
//	}
//}
